Internationalization Helper Utilities

Description

Makes it easy to add language tags to different parts of an application

images/int.png

You can create apps that are designed to be used in multiple languages and around the world. The way this is done throughout Alpha Anywhere has been to use a special <a5:r></a5:r> or <a5:t></a5:t> tag around the label or text that you want to internationalize. The alternate spellings for each of the controls that are tagged can then be defined in the 'Language definition' property on UX Properties page. The Internationalization Helper Utilities option on the Additional Options Menu allows for multiple parts of an application to be tagged in one go. For a explanation on how to use the Internationalization Helper Utilities watch this video or read on.

Options

There are several different ways that you can go about assigning internationalization tags.

images/int2.png

You can choose to apply internationalization tags to all of the places in the application that will accept them by clicking the 'Select All Options' button.

images/int3.png

Alternatively, you can use the 'Select Option' button to add internationalization tags to a particular type of control or text in the application. A menu will open with the following options:

  • Control Labels
  • List Control Column Headings
  • List Control Detail View
  • StaticText Controls
  • Button Controls
  • Frame Controls
  • Bubble Help - Labels
  • Bubble Help - Fields
  • Bubble Help - Other
  • DatePicker - 'day name' Labels
  • DatePicker - 'month name' Labels
  • System messages

Add Text Dictionary Tags to a Control Type.

Text Dictionary tags, written <a5:t></a5:t>, were added to Alpha Anywhere after the standard <a5:r></a5:r> language tags were implemented. These tags can be used very effectively for the internationalization of applications. Unlike standard language tags, text dictionary tags are stored in a SQL database. This makes it easy to add language definitions to text that utilize, for example, Japanese or Chinese characters; without having to go through the trouble of looking up unicode values or escaping certain characters in a string. You can also use Text Dictionary Tags to add external HTML to specified areas of text. There is a video on how to implement text dictionary tags that you can watch here. You can also follow the guide below.

Create a New Text Dictionary Table

  1. In the Web Projects Control Panel click on the Project Properties button in the panel toolbar.

    images/tdt.png
  2. Scroll down to and expand the 'Text Dictionary Table Settings' section. Click on the [...] button next to the Connection string property.

    images/tdt2.png
  3. Set the Table Type to SQL

    images/tdt3.png
  4. Click the [...] button next to the 'Connection string' property and form a connection string to the Northwind database.

    images/tdt4.png
  5. Type the name of the Table you wish to create in the 'Table name' property.

    images/tdt5.png
  6. Click the 'Create Text Dictionary Table' button at the bottom of the 'Define Text Dictionary Table' dialog. Click OK.

    images/tdt6.png

Define New Tags in the Text Dictionary Table

  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the [TextBox] option to add a textbox control to the component. Give the control the name 'textbox1' and the label 'string1'.

    images/nt.png
  2. Add a second [TextBox] control to the component with the name 'textbox2' and the label 'string2'.

    images/nt2.png
  3. Add a third [TextBox] control to the component with the name 'textbox3' and the label 'string3'.

    images/nt3.png
  4. Click the 'Menu' dropdown in the UX Controls page toolbar. Select the 'Internationalization Helper Utilities' option.

    images/nt4.png
  5. Click the 'Select Option' button, select 'Control Labels', then choose the 'Add Text Dictionary tags to all control Labels' option.

    images/nt5.png
  6. The labels of the controls you defined should appear in the dialog. Click the 'Execute Code' button. You should get a message stating that some changes were made to the UX Component. Click OK.

    images/nt6.png
  7. Open the UX Properties page. Scroll down to the 'Other' properties section. Click the [...] button next to the 'Text dictionary tags' property.

    images/nt7.png
  8. Highlight 'string1' in the 'Text Dictionary Tags Used in this Component' list. Click the 'Create New Text Dictionary Entry' button

    images/nt8.png
  9. To create a default language entry leave the Enter Language dialog blank and click OK.

    images/nt9.png
  10. Enter some text into the Enter Text dialog to define the default language value for 'sting1'. Click OK.

    images/nt10.png
  11. Click the 'Create New Text Dictionary Entry' button a second time. Enter the name of a second language entry that you want to define.

    images/nt11.png
  12. Define some text for the second language. To create new definitions, external sites like Google Translate can be helpful.

    images/nt12.png
  13. Add as many language definitions as you want and define each of the labels for the three controls. Click Close to return to the UX Properties page.

    images/nt13.png
  14. In the 'Other' properties section of the UX Properties page locate the 'Active language' property. Choose one of the languages you defined and type its name into the 'Active language' property.

    images/nt14.png
  15. Run the component in Live Preview, each of the labels should contain the defined text for the active language.

    images/nt15.png

Add Language Tags to a Control Type.

  1. In the UX Builder on the UX Controls page open the 'Other Controls' menu. Click on [Button] to add a button control to the component. Add several button controls.

    images/ihu2.png
  2. Add some different Button text to each of the buttons by highlighting each button control and entering the new text into the 'Button text' property, in the Button Properties section of the properties list.

    images/ihu3.png
  3. Organize the buttons in the controls tree.

    images/ihu.png
  4. After naming all of the button click on the 'Menu' dropdown on the UX Controls page toolbar. Select the 'Internationalization Helper Utilities' option.

    images/ihu4.png
  5. Click the 'Select Option' button. From the list of options select the 'Button Controls' option. Then select the 'Add language tags to text in all button controls' option.

    images/ihu5.png
  6. You should see a list appear with all of the button controls that tags will be added to. Click the 'Execute Code' button.

    images/ihu6.png
  7. Close the dialog. Go back to one of the 'Button text' properties you defined on the UX Controls page. This should now have an internationalization tag around it.

    images/ihu7.png
  8. Open the UX Properties page. Scroll down the list of properties to the 'Other' section'. Click the [...] button next to the 'Language definitions' property.

    images/ihu8.png
  9. Click the 'Add Language' button and name the new language.

    images/ihu9.png
  10. Click the 'Refresh List of Placeholders' button. You should see the buttons that you defined text for appear with an equals sign next to it.

    images/ihu10.png
  11. Translate each button into the new language that you added by placing the new term after the equals sign. Click OK

    images/ihu11.png
    You need to escape commas incorporated into any text by using a backslash '\' character.
  12. Still in the 'Other' Section of the UX Properties page, set the 'Active language' property to the language you defined.

    images/ihu12.png
  13. Run the component in Live Preview. You should see all of the buttons displaying the active language.

    images/ihu13.png

Remove Language or Text Dictionary Tags

This option allows you to remove tags from groups of text that you have already tagged. Note that doing this will not alter the SQL table that is defined to create Text Dictionary tags.